在COPY 檔案後,遇到這個問題,記錄一下.
狀況
VS2003 專案的tree亂掉 : A檔案與B檔案連在一起
建置會過,程式功能也都正常
檢查
用記事本打開 Project.csproj
查看有問題的檔案
<File
RelPath = "A.aspx"
SubType = "Form"
BuildAction = "Content"
/>
<File
RelPath = "A.aspx.cs"
DependentUpon = "B.aspx"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
<File
RelPath = "B.aspx"
SubType = "Form"
BuildAction = "Content"
/>
<File
RelPath = "B.aspx.cs"
DependentUpon = "B.aspx"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
處理方法
把DependentUpon 改成跟RelPath一樣就可以了
<File
RelPath = "A.aspx"
SubType = "Form"
BuildAction = "Content"
/>
<File
RelPath = "A.aspx.cs"
DependentUpon = "A.aspx"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
備註
如果有用VSS,只想CHECK OUT專案檔的話,不想全部的專案都CHECK OUT下來的話.
可以先用"Microsoft Visual SourceSafe" ,將專案檔CHECK OUT下來,用記事本改完再CHECK IN回去.
"C:\Program Files (x86)\Microsoft Visual Studio\VSS\win32\SSEXP.EXE"